#!/bin/bash

# 更新代码
git pull

# 停止并删除旧的容器
docker stop cb
docker rm cb

# 删除旧的镜像
docker rmi cb

# 构建新的 Docker 镜像
docker build -t cb .

# 运行新的容器，确保端口不会冲突
docker run -d -p 8745:80 --name cb cb

echo "Docker container 'cb' has been restarted successfully on port 8745."